<?php include_stylesheets_for_form($form) ?>
<?php include_javascripts_for_form($form) ?>


<script type="text/javascript">
$(function() {

        $("#urltype_temp_date_start").datepicker(
                {buttonText: 'Select Date', showOn: 'button', dateFormat: 'mm-dd-yy', minDate: new Date(),
                    onSelect: function(dateText, inst){
                        var theDate = new Date(Date.parse($(this).datepicker('getDate')));
                        var dateFormatted = $.datepicker.formatDate('D, MM d, yy', theDate);
                        $("#gestdent_afp_nombre").text(dateFormatted);
                        $("#temp_date_start").text(dateFormatted);
                        $("#hola").click();
                    }
                }
        );

    });
    </script>

<input id="urltype_temp_date_start" name="urltype_temp_date_start" /><span id="temp_date_start"></span>



<form action="<?php echo url_for('afp/'.($form->getObject()->isNew() ? 'create' : 'update').(!$form->getObject()->isNew() ? '?id='.$form->getObject()->getId() : '')) ?>" method="post" <?php $form->isMultipart() and print 'enctype="multipart/form-data" ' ?>>
<?php if (!$form->getObject()->isNew()): ?>
<input type="hidden" name="sf_method" value="put" />
<?php endif; ?>
  <table>
    <tfoot>
      <tr>
        <td colspan="2">
          &nbsp;<a href="<?php echo url_for('afp/index') ?>">Volver</a>
          <?php if (!$form->getObject()->isNew()): ?>
            &nbsp;<?php echo link_to('Eliminar', 'afp/delete?id='.$form->getObject()->getId(), array('method' => 'delete', 'confirm' => 'Confirmar eliminacion?')) ?>
          <?php endif; ?>
          <input id="hola" type="submit" value="Guardar" />
        </td>
      </tr>
    </tfoot>
    <tbody>
      <?php echo $form ?>
    </tbody>
  </table>
</form>



